﻿using System.Data.SqlTypes;
using NUnit.Framework;

namespace Fotia.SqlClr.Tests
{
	[TestFixture]
	public class FormatStringMaxTests
	{
		[Test]
		public void CanFormatStringMax0()
		{
			var input0 = new SqlString("Input0");
			var output = FormatStringMax.FormatStringMax0("Formatted:{0}", input0);

			Assert.AreEqual("Formatted:Input0", output.Value);
		}

		[Test]
		public void CanFormatStringMax1()
		{
			var input0 = new SqlString("Input0");
			var input1 = new SqlString("Input1");
			var output = FormatStringMax.FormatStringMax1("Formatted:{0}{1}", input0, input1);

			Assert.AreEqual("Formatted:Input0Input1", output.Value);
		}

		[Test]
		public void CanFormatStringMax2()
		{
			var input0 = new SqlString("Input0");
			var input1 = new SqlString("Input1");
			var input2 = new SqlString("Input2");
			var output = FormatStringMax.FormatStringMax2("Formatted:{0}{1}{2}", input0, input1, input2);

			Assert.AreEqual("Formatted:Input0Input1Input2", output.Value);
		}

		[Test]
		public void CanFormatStringMax3()
		{
			var input0 = new SqlString("Input0");
			var input1 = new SqlString("Input1");
			var input2 = new SqlString("Input2");
			var input3 = new SqlString("Input3");
			var output = FormatStringMax.FormatStringMax3("Formatted:{0}{1}{2}{3}", input0, input1, input2, input3);

			Assert.AreEqual("Formatted:Input0Input1Input2Input3", output.Value);
		}
	}
}